package com.fowo.api.controller.shipment.fbainvoice;

import com.fowo.api.model.fbainvoice.FBAInvoiceMarkLockedAction;
import com.fowo.api.model.fbainvoice.FBAInvoiceVo;
import com.fowo.api.service.impl.FBAInvoiceServiceImpl;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component()
public class fbaInvoiceMarkLockedAction implements FBAInvoiceMarkLockedAction {
    @Resource
    private FBAInvoiceServiceImpl fbaInvoiceServiceImpl;

    @Override
    public void run(List<Long> idList) throws Exception {
        for (int i = 0; i < idList.size(); i++){
            FBAInvoiceVo voById = fbaInvoiceServiceImpl.getVoById(idList.get(i));
            voById.setIslockinventory("1");
            fbaInvoiceServiceImpl.update(voById);
        }
    }
}
